package com.jeethink.erp.stockDetail.service.impl;

import java.util.List;
import com.jeethink.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jeethink.erp.stockDetail.mapper.TbEnterStockDetailMapper;
import com.jeethink.erp.stockDetail.domain.TbEnterStockDetail;
import com.jeethink.erp.stockDetail.service.ITbEnterStockDetailService;

/**
 * 入库单详细信息Service业务层处理
 * 
 * @author ypr
 * @date 2021-06-01
 */
@Service
public class TbEnterStockDetailServiceImpl implements ITbEnterStockDetailService 
{
    @Autowired
    private TbEnterStockDetailMapper tbEnterStockDetailMapper;

    /**
     * 查询入库单详细信息
     * 
     * @param id 入库单详细信息ID
     * @return 入库单详细信息
     */
    @Override
    public TbEnterStockDetail selectTbEnterStockDetailById(Long id)
    {
        return tbEnterStockDetailMapper.selectTbEnterStockDetailById(id);
    }

    /**
     * 查询入库单详细信息列表
     * 
     * @param tbEnterStockDetail 入库单详细信息
     * @return 入库单详细信息
     */
    @Override
    public List<TbEnterStockDetail> selectTbEnterStockDetailList(TbEnterStockDetail tbEnterStockDetail)
    {
        return tbEnterStockDetailMapper.selectTbEnterStockDetailList(tbEnterStockDetail);
    }

    /**
     * 新增入库单详细信息
     * 
     * @param tbEnterStockDetail 入库单详细信息
     * @return 结果
     */
    @Override
    public int insertTbEnterStockDetail(TbEnterStockDetail tbEnterStockDetail)
    {
        tbEnterStockDetail.setCreateTime(DateUtils.getNowDate());
        return tbEnterStockDetailMapper.insertTbEnterStockDetail(tbEnterStockDetail);
    }

    /**
     * 修改入库单详细信息
     * 
     * @param tbEnterStockDetail 入库单详细信息
     * @return 结果
     */
    @Override
    public int updateTbEnterStockDetail(TbEnterStockDetail tbEnterStockDetail)
    {
        tbEnterStockDetail.setUpdateTime(DateUtils.getNowDate());
        return tbEnterStockDetailMapper.updateTbEnterStockDetail(tbEnterStockDetail);
    }

    /**
     * 批量删除入库单详细信息
     * 
     * @param ids 需要删除的入库单详细信息ID
     * @return 结果
     */
    @Override
    public int deleteTbEnterStockDetailByIds(Long[] ids)
    {
        return tbEnterStockDetailMapper.deleteTbEnterStockDetailByIds(ids);
    }

    /**
     * 删除入库单详细信息信息
     * 
     * @param id 入库单详细信息ID
     * @return 结果
     */
    @Override
    public int deleteTbEnterStockDetailById(Long id)
    {
        return tbEnterStockDetailMapper.deleteTbEnterStockDetailById(id);
    }
}
